package com.wisezone.workflow.core;

import java.util.List;

import com.wisezone.workflow.bean.WfProcessDefinition;
import com.wisezone.workflow.bean.search.WfProcessInstanceSearch;
import com.wisezone.workflow.exception.WfCoreException;

/**
 * 流程模板对象
 * @author tss 2009-09-05
 *
 */

public interface ProcessDefinition extends BaseProperty {
	

	
    /**
     * 根据ID加载该流程模版下的一个活动
     * @param id
     * @return
     * @throws WfCoreException
     */
    public Activity loadActivityById(Long id) throws WfCoreException;
    
    /**
     * 根据ID加载该流程模版下的一个开始活动
     * @param id
     * @return
     * @throws WfCoreException
     */
    public Activity loadStartActivity() throws WfCoreException;
    
    /**
     * 加载该模板下一个的结束活动
     * @return
     * @throws WfCoreException
     */
    public Activity loadEndActivity() throws WfCoreException;
    
    
    /**
     * 根据ID加载该流程模版下的一个活动实例
     * @param id
     * @return
     * @throws WfCoreException
     */
    public ActivityInstance loadActivityInstance(Long id) throws WfCoreException;
    
    /**
     * 创建一个流程实例
     * @return
     * @throws WfCoreException
     */
	public ProcessInstance createProcessInstance() throws WfCoreException;
	
	/**
	 * 激活
	 * @throws WfCoreException
	 */
	public void enabled() throws WfCoreException;

	/**
	 * 禁用
	 * @throws WfCoreException
	 */
	public void disabled() throws WfCoreException;

    /**
     * 根据ID加载该流程模版的一个流程实例
     * @param id
     * @return
     * @throws WfCoreException
     */
	public ProcessInstance loadProcessInstById(Long id) throws WfCoreException;
	
	 /**
     * 获得该模版下的所有流程实例
     * @return
     * @throws WfCoreException
     */
	public List<ProcessInstance> getProcessInstList() throws WfCoreException;
	
	/**
	 * 获得该模版下的所有流程实例(根据条件)
	 * @return
	 * @throws WfCoreException
	 */
	public List<ProcessInstance> getProcessInstList(WfProcessInstanceSearch search) throws WfCoreException;
	
	
	/**
	 * 加载该流程模版下的所有活动
	 * @return
	 * @throws WfCoreException
	 */
	public List<Activity> getActivityList() throws WfCoreException;
	
	/**
	 * 获得中间活动列表
	 * @return
	 * @throws WfCoreException
	 */
	public List<Activity> getMiddleActivityList() throws WfCoreException;
	

	public WfProcessDefinition getModel();


	public void setModel(WfProcessDefinition wfProcessDefinition);


    




	
	
	
	
	
}
